<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
    <h:head>
        <title>iNET- Tiện ích văn phòng</title>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <link rel="shortcut icon" href="/TienIchVanPhong/resources/images/logo.png" />
        <h:outputStylesheet library="css" name="menu.css"/>
        <h:outputStylesheet library="css" name="style.css"/>
        <h:outputStylesheet library="css" name="BeatPicker.min.css"/>
        <h:outputScript library="js" name="jquery-1.11.0.min.js"/>
        <h:outputScript library="js" name="BeatPicker.min.js"/>

    </h:head>
    <h:body>
        <h:form id="an">

            <!--Start header-->
            <ui:include src="/resources/template/header.xhtml"/>
            <!--end header-->

            <div class="main">
                <!-- Menu left-->

                <ui:include src="/resources/template/left.xhtml"/>

                <!--end menu left-->

                <!--nội dung-->
                <div class="right"> <br/>
                    <p align="center"><b>DANH SÁCH NHÂN VIÊN</b></p>
                    <div class="controll">
                        <h:selectOneMenu value="#{departmentController.branch.branch_id}" id="txtTrungTam" class="chonadd" pt:required="">
                            <f:selectItem itemLabel="---Chọn một trung tâm---"/> 
                            <f:selectItems value="#{branchController.listBranch}" var="b" itemLabel="#{b.branch_name}" itemValue="#{b.branch_id}" />
                            <f:ajax execute="txtTrungTam" render="txtPhongBan" />
                        </h:selectOneMenu>
                        <h:selectOneMenu value="#{employeeController.posishow.dep_id}" id="txtPhongBan" class="chonadd" pt:required="">  
                            <f:selectItem itemValue="" itemLabel="---Chọn 1 phòng ban---"/>
                            <f:selectItems value="#{departmentController.lstdepBranch}" var="d" itemValue="#{d.dep_id}" itemLabel="#{d.dep_name}"/>
                        </h:selectOneMenu>
                        <h:commandButton styleClass="btnSubmid" value="Hiển thị" action="#{employeeController.search()}"></h:commandButton>
                    </div>
                    <br/>
                    <p align="center" style="margin: 10px;color: red"> <h:messages  style="color: red;list-style: none;text-align: center"/> </p>
                    <br/>


                    <h:dataTable value="#{employeeController.showEmployee}" var="o"
                                 styleClass="bordered"
                                 >

                        <h:column>

                            <f:facet name="header">Mã NV</f:facet>
                            <h:outputText value="#{o.emp_code}" />

                        </h:column>

                        <h:column>

                            <f:facet name="header">Họ đệm</f:facet>

                            <h:outputText value="#{o.first_name}" />

                        </h:column>

                        <h:column>

                            <f:facet name="header">Tên</f:facet>

                            <h:outputText value="#{o.last_name}" />

                        </h:column>

                        <h:column>

                            <f:facet name="header">ĐT</f:facet>

                            <h:outputText value="#{o.emp_mobile}" />

                        </h:column>

                        <h:column>

                            <f:facet name="header">Email</f:facet>

                            <h:outputText value="#{o.emp_email}" />

                        </h:column>

                        <h:column>

                            <f:facet name="header">Quốc gia</f:facet>

                            <h:outputText value="#{o.nationality}" />

                        </h:column>

                        <h:column>

                            <f:facet name="header">Trình độ</f:facet>

                            <h:outputText value="#{o.lyteracy}" />

                        </h:column>
                        <h:column>

                            <f:facet name="header">Địa chỉ</f:facet>

                            <h:outputText value="#{o.address}" />

                        </h:column>

                        <h:column>

                            <f:facet name="header"></f:facet>
                            <h:commandLink style="margin: 3px;" value="Ẩn" action="#{employeeController.hideEmp(o.emp_id)}"/>
                        </h:column>
                    </h:dataTable>
                    <br/>

                </div>

                <!-- end dội dung-->
            </div>
            <!--Footer-->
            <ui:include src="/resources/template/footer.xhtml"/>
            <!--end footer-->

        </h:form>
    </h:body>
</html>

